<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title><ui:insert name="title">Default Title</ui:insert></title>
        <h:outputStylesheet name="css/jsfcrud.css"/>
    </h:head>

    <h:body>

        <h:form id="form">
            <p:growl id="growl" />

            <p:tabMenu activeIndex="2">  
                <p:menuitem value="Compte[#{loginController.findName()}]" url="index.xhtml" icon="ui-icon-mail-open"/>  
                <p:menuitem value="Acceuil" url="index.xhtml" icon="ui-icon-home" />  
                <p:menuitem value="Catégories" url="Categories.xhtml" icon="ui-icon-folder-collapsed"/>  
                <p:menuitem value="Déconnecter" url="index.xhtml" icon="ui-icon-power" />  
                <p:menuitem value="Rechercher"  url="#" icon="ui-icon-search"> 

                    <h:panelGrid columns="12" cellpadding="0">  
                        <h:outputLabel for="Rechercher" value="Rechercher:" style="font-weight:bold"/>  

                        <p:inputText id="categorieName" value="#{rechercheController.categorieName}" />  

                        <p:commandButton value="go" action="#{rechercheController.Search()}" update="growl"/>  

                    </h:panelGrid> 

                </p:menuitem>
            </p:tabMenu>  

            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>

                <h:dataTable value="#{categController.findByIdCategorie()}" var="item" border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px">
                    <h:column> 
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListProduitTitle_nomProduit}"/>
                        </f:facet>
                        <h:form>
                            <p:commandButton value="#{item.nomProduit}" />
                        </h:form>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListProduitTitle_prix}"/>
                        </f:facet>
                        <h:form>
                            <p:commandButton value="#{item.prix}" />  
                        </h:form>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Buy"/>
                        </f:facet>
                        <select name="#{item.nomProduit}">
                            <option>1</option>
                            <option>2</option>
                            <option>3</option>
                            <option>4</option>
                            <option>5</option>
                            <option>6</option>
                            <option>7</option>
                            <option>8</option>
                            <option>9</option>
                            <option>10</option>
                        </select>
                    </h:column>

                    <h:column>   
                    </h:column>

                </h:dataTable>
            </h:panelGroup>
        </h:form>  
        <h:form>                     <p:selectManyCheckbox value="#{acheteController.selectedOptions}"> 
      
            <h:dataTable value="#{categController.findByIdCategorie()}" var="items" border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px">
               <p:column>
                        <f:selectItem itemLabel="#{items.nomProduit}" itemValue="#{items.nomProduit}" />  
                    </p:column>
            </h:dataTable>                </p:selectManyCheckbox>    

        </h:form>

        <p:commandButton value="Submit" update="display" oncomplete="dlg.show()" />  

        <p:dialog header="Selected Values" modal="true" showEffect="fade" hideEffect="fade" widgetVar="dlg">  
            <p:outputPanel id="display">  
                <p:dataList value="#{acheteController.selectedOptions}" var="item">  
                    <h:outputLabel value="#{item}"/>
                </p:dataList>   
            </p:outputPanel>  
        </p:dialog>  

    </h:body>

</html>